<template>
	<view>
		<!-- #ifdef MP-WEIXIN || MP-TOUTIAO -->
		<view class="demo"
			:style="'height:' +  demo.height + 'px;' + 'padding-top:' + demo.top + 'px;padding-bottom:10rpx'">
			<view class="left" :style="'top:' + demo.top + 'px'" @click="onbackBtn">
				<image src="https://images.linglinggong.net/icon1/20.png" mode=""></image>
			</view>
			已发布
		</view>
		<!-- #endif -->
		<!-- #ifdef MP-ALIPAY -->
		<view class="demo"
			:style="'height:' +  demo.height + 'px;' + 'padding-top:' + demo.top + 'px;padding-bottom:10rpx'">
			<view class="left" :style="'top:' + demo.top + 'px'" @click="onbackBtn">
				<image src="https://images.linglinggong.net/static/icon1/back.png" mode=""></image>
			</view>
			已发布
		</view>
		<!-- #endif -->
		<succeed :title="title" :buttonTitle="buttonTitle" :info="'审核时间预计3分钟'"></succeed>
	</view>
</template>

<script>
	import succeed from '../../../../components/xjbg/succeed.vue'
	export default {
		data() {
			return {
				title: '您的任务已发布',
				buttonTitle: '查看任务',
				demo: {
					top: 48,
					height: 32
				},
			};
		},
		components: {
			succeed
		},
		onReady() {
			//#ifdef MP-ALIPAY
			if (my.canIUse('hideBackHome')) {
				this.navbarInit()
			}
			//#endif
		},
		methods: {
			/* 初始化支付宝小程序navbar */
			navbarInit() {
				my.hideBackHome()
				my.hideAddToDesktopMenu();
			},
			/* 获取小程序导航栏的高度 */
			getMenuBar() {
				const demo = uni.getMenuButtonBoundingClientRect()
				this.demo.top = demo.top
				this.demo.height = demo.height
			},
			onbackBtn(){
				uni.redirectTo({
					url: '/pages/my-job/boss-my-job-new'
				})
			}
		},
		onLoad() {
			// #ifdef MP-WEIXIN || MP-TOUTIAO
			this.getMenuBar()
			// #endif
		}
	}
</script>

<style lang="less" scoped>
	// #ifdef MP-WEIXIN || MP-TOUTIAO
	.demo {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #fff;
		font-size: 26rpx;
		width: 100vw;
	
		.left {
			float: left;
			position: absolute;
			width: max-content;
			height: max-content;
			top: 0;
			bottom: 0;
			left: 0;
			padding-left: 20rpx;
			width: 100rpx;
			margin: auto;
	
			image {
				width: 19rpx;
				height: 32rpx;
			}
		}
	}
	
	//#endif
	//#ifdef MP-ALIPAY
	.demo {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #fff;
		font-size: 26rpx;
	
		.left {
			position: absolute;
			width: max-content;
			height: max-content;
			top: 0;
			bottom: 0;
			padding-left: 40rpx;
			left: 0;
			margin: auto;
			width: 100rpx;
	
			image {
				width: 25rpx;
				height: 44rpx;
			}
		}
	}
	
	// #endif
</style>
